Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script src="loadxmldoc.js"> </script> <script> //check if the first node is an element node function get_nextSibling(n) { y=n.nextSibling; while (y.nodeType!=1) { y=y.nextSibling; } return y; } </script> </head> <body> <script> xmlDoc=loadXMLDoc("books.xml"); x=get_nextSibling(xmlDoc.getElementsByTagName("title")[0]); document.write(x.nodeName); </script> </body> <!-- Mirrored from www.w3schools.com/dom/tryit.asp?filename=try_dom_nav_nextsibling by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 07:26:38 GMT --> </html>
Result:
Try it Yourself - © w3schools.com